;(function () {
	new Vue({
		el: '#preview-fields',
		data: {
			tmpData: [],
			pcMoblieData: ['PC', 'H5'],
			selectPcMoblie: 'PC',
			type: [{ name: '公司', code: 'QY' }, { name: '个人', code: 'PE' }],
			typeAct: ['QY'],
			isblack: [{ name: '是', code: 'QY' }, { name: '否', code: 'PE' }	],
			textTypeAll: ['text', 'mobile', 'email', 'phone'],
			flexTypes: ['text', 'mobile', 'email', 'phone', 'select', 'time', 'date'],
			data: [],
			resData: [],
			headPcUrl: '',
			headMbUrl: '',
			type: hlUrlUtil.GetQueryString('type'),
			noShow: ['CONTRACT', 'VISITOR_FORM']
		},
		methods: {
			urlRepleace () { 
				var self = this;
				switch (this.type){
					case 'CUSTOMER':
						self.headPcUrl = 'https://file.1hello.com/res/4c1ca10e6b70cc2cc2308ada82317f60.jpg'
						self.headMbUrl = 'https://file.1hello.com/res/1221205dc8b5862b608ad8645efba6f0.png'
						break;
					case 'MARKET_EXPANSION_PROJECT':
						self.headPcUrl = 'https://file.1hello.com/res/d90d433e097ed0d27fdfeab99d7c05d1.jpg'
						self.headMbUrl = 'https://file.1hello.com/res/9e780dc32b5206ce368e9b1608de6dc9.jpg'
						break;
					case 'CONTRACT':
						self.headPcUrl = 'https://file.1hello.com/res/91b03adc042fdd5be27e977e677baaba.png'
						self.headMbUrl = ''
						break;
					case 'VISITOR_FORM':
						self.headPcUrl = 'https://file.1hello.com/res/f5316db77103efa24e181a05a24a76b1.png'
						self.headMbUrl = ''
						break;
					default:
						break;
				}
			},
			//去除html标签
			delHtmlTag(str) {
				var reg = RegExp("<[^>]+>", "g");
				var result = str.replace(reg, '');
				return result; 
			},
			//关闭当前窗口
			closeWindow () {
				window.close();
			}
		},
		mounted() {
			if (localStorage.getItem('previewPcMoblie')) {				
				sessionStorage.setItem('previewPcMoblie', localStorage.getItem('previewPcMoblie'))
				localStorage.removeItem('previewPcMoblie')
			}
			this.tmpData = JSON.parse(sessionStorage.getItem('previewPcMoblie'))		
			this.urlRepleace()
		}
	})
} ())